import Mock from 'mockjs'

const roleList = []
const count = 5
const name = ['管理员', '风控员', '调解员', '财务', '宣传员']

for (let i = 0; i < count; i++) {
  roleList.push(Mock.mock({
    id: i+1,
    remarks: '@ctitle',
    name: name[i],
    'type|1': [0, 1], //0 内置，1 普通
    'status|1': [0, 1] //0 正常，1 禁用
  }))
}

export default [
  {
    url: '/roles/list',
    type: 'get',
    response: _ => {
      return {
        code: 0,
        msg: 'ok',
        data: roleList
      }
    }
  },

  {
    url: '/roles/add',
    type: 'post',
    response: _ => {
      return {
        code: 0,
        data: 'success'
      }
    }
  },

  {
    url: '/roles/edit',
    type: 'post',
    response: _ => {
      return {
        code: 0,
        data: 'success'
      }
    }
  },

  {
    url: '/roles/change-status',
    type: 'post',
    response: _ => {
      return {
        code: 0,
        data: 'success'
      }
    }
  },

  {
    url: '/roles/reset-password',
    type: 'post',
    response: _ => {
      return {
        code: 0,
        data: 'success'
      }
    }
  }
]

